// IO 函子
const fp = require('lodash/fp')
class IO {
  static of(val){
    return new IO(function () {
      return val
    })
  }
  constructor(fn){
    this._val=fn
  }
  map(fn){
    return new IO(fp.flowRight(fn,this._val))
  }
}
// 调用
let r = IO.of(process).map(p => p.execPath)
// console.log(r)
console.log(r._val())